home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / opal / Flamin12.lha / Flaminator.oprx next >
Text File  |  1993-03-06  |  17KB  |  636 lines

  1. /*                       FLAMINATOR v1.2                           */
  2. /*                                                                 */
  3. /*                    ©1993 Carmen Rizzolo                         */
  4. /*                                                                 */
  5. /*                     for OpalPaint v1.4+                         */
  6. /*                                                                 */
  7.  
  8. /* History:                                                        */
  9. /* v0.9   2/24/93  Just Starting, but the program is pretty much   */
  10. /*                 done, in my head.                               */
  11. /* v0.95  2/25/93  The script is done and (semi-)functional, but   */
  12. /*                 it's bumping into bugs.  Needs a little         */
  13. /*                 polishing.                                      */
  14. /* v1.0   2/25/93  Finally done and fairly stable.  Consult        */
  15. /*                 documentation for more info.                    */
  16. /* v1.0a  2/25/93  Fixed version number in startup requestor.      */
  17. /*                 Fixed Method number in one of these goofy       */
  18. /*                 REMARK thingies.  Nothing that matters.         */
  19. /* v1.0b  2/26/93  Corrected some spelling errors in the           */
  20. /*                 documentation.                                  */
  21. /* v1.1   2/26/93  Vastly icreased speed.  By optimizing the       */
  22. /*                 diffusion and smoothing process.  Now uses Blur */
  23. /*                 DrawMode instead of Smooth to avoid the cross-  */
  24. /*                 hatch look.  Then Uses Smooth DrawMode for top  */
  25. /*                 scanline to repair Blur's sloppiness.  Only one */
  26. /*                 or two Smooth passes are really all you'll ever */
  27. /*                 need now.                                       */
  28. /*                 Also, the flames seem to look better now.       */
  29. /* v1.1b 2/26/93   Now only performs diffuse and blur operations   */
  30. /*                 from upper-left corner to brush-size + 25       */
  31. /*                 pixels.                                         */
  32. /* v1.1c 2/27/93   Now only performs diffuse and blur operations   */
  33. /*                 from upper-left of brush to lower-left of brush */
  34. /*                 MUCH faster.                                    */
  35. /* v1.1d 2/27/93   Speeded it up a bit more.  I don't think I can  */
  36. /*                 squeeze much more speed out of this thing!      */
  37. /* v1.1e 2/28/93   Do you want to go FASTER??! :)  I did it again. */
  38. /*                 It's turbo-charged, especially for Hi-Res work. */
  39. /*                 I also changed the sample images.  I think it   */
  40. /*                 makes a bit of a better animation now.          */
  41. /* v1.1f 3/2/93    Fixed some bad syntax.  Thanks for the          */
  42. /*                 correction Martin!                              */
  43. /* v1.2  3/6/93    By request, I added another 'method.'  Be       */
  44. /*                 sure to browse the documentation for a full     */
  45. /*                 explanation of how this works.                  */
  46.  
  47. /*  See documentation for more information                         */
  48.  
  49. /* Initialization of variables.  Don't touch unless you know what
  50.    you are doing. */
  51. ROOT = 'pic.'
  52. ZERO = '0'
  53. Options Results
  54. Address 'OpalPaint_Rexx'
  55.  
  56. /* Give the option to abort */
  57. AskBool 'FLAMINATOR ©1993 Carmen Rizzolo - v1.2\nOK to continue, Cancel to abort.'
  58. If Result = 0 Then Exit
  59.  
  60. /* Ask method */
  61. AskInt 0 2 0 'Choose BACKGROUND source method:\n0 = Static  1 = Animated  2 = Current\nSee documentation for more information.'
  62. If RC = 5 Then Do
  63.     Okay 'Exiting...'
  64.     Exit
  65.     End
  66. Method = Result
  67.  
  68. /* Get flame colour */
  69. AskInt 1 6 1 'Choose flame colour:\n1 = Normal  2 = Yellow  3 = Red  4 = Blue  5 = Green  6 = Purple'
  70. If RC = 5 Then Do
  71.     Okay 'Exiting...'
  72.     Exit
  73.     End
  74. FlameColour = Result
  75.  
  76. /* Ask flame size (Diffuse value) */
  77. AskInt 1 31 11 'Choose flame size:\nFrom 1 to 31.'
  78. If RC = 5 Then Do
  79.     Okay 'Exiting...'
  80.     Exit
  81.     End
  82. FlameSize = Result
  83.  
  84. /* Convert FlameSize into an odd number if needed */
  85. If FlameSize/2 = FlameSize%2 Then FlameSize = FlameSize - 1
  86.  
  87. /* Ask smooth value (# of smoothing passes) */
  88. AskInt 1 3 1 'Choose flame smoothing:\nFrom 1 to 3.\nThis is the number of smooth passes.'
  89. If RC = 5 Then Do
  90.     Okay 'Exiting...'
  91.     Exit
  92.     End
  93. SmoothValue = Result
  94.  
  95. /* Ask intensity (# of times the flame brush is stamped) */
  96. AskInt 1 4 1 'Choose flame intensity.'
  97. If RC = 5 Then Do
  98.     Okay 'Exiting...'
  99.     Exit
  100.     End
  101. FlameIntensity = Result
  102.  
  103. /* Get background source image(s) pathname: */
  104. If Method < 2 Then Do Forever
  105.     Askstring 'Enter the pathname of your BACKGROUND source image(s).\nEnter pathname only, and WITHOUT final "/"\nExample: "DH0:Torch/" = wrong  "DH0:Torch" = right'
  106.     If RC = 5 Then Do
  107.         Okay 'Exiting...'
  108.         Exit
  109.         End
  110.     If Result ~= "" Then Do
  111.         BackgroundSource = Result
  112.         Finder = Exists(BackgroundSource || '/')
  113.         If Finder = 1 Then Do
  114.             Leave
  115.             End
  116.         End
  117.     Okay 'Drawer not found!  Check your spelling.'
  118.     End
  119.  
  120. /* Check for first image of Backgrounds for Method 0 */
  121. If Method = 0 Then Do
  122.     Finder = Exists(BackgroundSource || '/pic.0001')
  123.     If Finder = 0 Then Do
  124.         Okay 'FATAL ERROR!  There must be at least a "pic.0001" image\nin your background source drawer when using method 1.\nExiting...'
  125.         Exit
  126.         End
  127.     End
  128.  
  129. /* Get flame source images pathname: */
  130. Do Forever
  131.     Askstring 'Enter the pathname of your FLAME source images.\nEnter pathname only, and WITHOUT final "/"\nExample: "DH0:Torchflame/" = wrong  "DH0:Torchflame" = right'
  132.     If RC = 5 Then Do
  133.         Okay 'Exiting...'
  134.         Exit
  135.         End
  136.     If Result ~= "" Then Do
  137.         FlameSource = Result
  138.         If FlameSource = BackgroundSource Then Do
  139.             Okay 'FATAL ERROR!  The FLAME source images can NOT be in\nthe same drawer as the BACKGROUND source images.\nPlease make sure you are REALLY ready to launch this script.\nRead the documentation for more info.  Exiting...'
  140.             Exit
  141.             End
  142.         Finder = Exists(FlameSource || '/')
  143.         If Finder = 1 Then Do
  144.             Leave
  145.             End
  146.         End
  147.     Okay 'Drawer not found!  Check your spelling.'
  148.     End
  149.  
  150. /* Get starting FLAME frame number */
  151. AskInt 1 9998 1 'Enter starting FLAME frame number as a normal number\nExamples:\n1 = Right  pic.0001 = Wrong  0001 = Wrong\nSee documentation for more information.'
  152. If RC = 5 Then Do
  153.     Okay 'Exiting...'
  154.     Exit
  155.     End
  156. StartFrame = Result
  157.  
  158. /* Get Ending FLAME frame number */
  159. Do Forever
  160.     AskInt 1 9999 20 'Enter Ending FLAME frame number as a normal number\nExamples:\n1 = Right  pic.0001 = Wrong  0001 = Wrong\nSee documentation for more information.'
  161.     If RC = 5 Then Do
  162.         Okay 'Exiting...'
  163.         Exit
  164.         End
  165.     EndFrame = Result
  166.     If EndFrame >= StartFrame Then Leave
  167.     Okay 'Ending FLAME frame number should be equal to or higher than\nStarting FLAME frame number.  Try again.'
  168.     End
  169.  
  170. /* Get Destination drawer for Method 0 */
  171. If Method = 0 Then Do
  172.     AskString 'Enter pathname for "flamed" destination images.\nWITHOUT final "/"\nExample: "DH0:Torchflame/" = wrong  "DH0:Torchflame" = right'
  173.     If RC = 5 Then Do
  174.         Okay 'Exiting...'
  175.         Exit
  176.         End
  177.     Do Forever
  178.         If Result ~= "" Then Do
  179.             FlameDest = Result
  180.             Finder = Exists(FlameDest || '/')
  181.             If Finder = 1 Then Do
  182.                 Leave
  183.                 End
  184.             If Finder = 0 Then Do
  185.                 AskBool 'Drawer not found.  Create one?\n[Cancel = No, lemme try agian]'
  186.                 If Result = 1 Then Do
  187.                     AskBool 'You typed:\n' || FlameDest || '\nIs this the drawer you want?\n[Cancel = No, lemme try agian]'
  188.                     If Result = 1 Then Do
  189.                         Address Command
  190.                         'Makedir ' || FlameDest
  191.                         Address 'OpalPaint_Rexx'
  192.                         Leave
  193.                         End
  194.                     End
  195.                 End
  196.             End
  197.         AskString 'Drawer not found!  Try Again.'
  198.             If RC = 5 Then Do
  199.             Okay 'Exiting...'
  200.             Exit
  201.             End
  202.         End
  203.     If FlameDest = BackgroundSource Then Do
  204.         Okay 'FATAL ERROR!  The FLAMED destination images can NOT be in\nthe same drawer as the BACKGROUND source images.\nPlease make sure you are REALLY ready to launch this script.\nRead the documentation for more info.  Exiting...'
  205.         Exit
  206.         End
  207.     End
  208.  
  209. /* Get Destination drawer for Method 2 */
  210. If Method = 2 Then Do
  211.     AskString 'Enter pathname for "flamed" destination images.\nWITHOUT final "/"\nExample: "DH0:Torchflame/" = wrong  "DH0:Torchflame" = right'
  212.     If RC = 5 Then Do
  213.         Okay 'Exiting...'
  214.         Exit
  215.         End
  216.     Do Forever
  217.         If Result ~= "" Then Do
  218.             FlameDest = Result
  219.             Finder = Exists(FlameDest || '/')
  220.             If Finder = 1 Then Do
  221.                 Leave
  222.                 End
  223.             If Finder = 0 Then Do
  224.                 AskBool 'Drawer not found.  Create one?\n[Cancel = No, lemme try agian]'
  225.                 If Result = 1 Then Do
  226.                     AskBool 'You typed:\n' || FlameDest || '\nIs this the drawer you want?\n[Cancel = No, lemme try agian]'
  227.                     If Result = 1 Then Do
  228.                         Address Command
  229.                         'Makedir ' || FlameDest
  230.                         Address 'OpalPaint_Rexx'
  231.                         Leave
  232.                         End
  233.                     End
  234.                 End
  235.             End
  236.         AskString 'Drawer not found!  Try Again.'
  237.             If RC = 5 Then Do
  238.             Okay 'Exiting...'
  239.             Exit
  240.             End
  241.         End
  242.     If FlameDest = BackgroundSource Then Do
  243.         Okay 'FATAL ERROR!  The FLAMED destination images can NOT be in\nthe same drawer as the BACKGROUND source images.\nPlease make sure you are REALLY ready to launch this script.\nRead the documentation for more info.  Exiting...'
  244.         Exit
  245.         End
  246.     End
  247.  
  248.  
  249. /* Ask if user wants to overwrite original files for Method 1*/
  250. If Method = 1 Then Do
  251.     AskBool 'Overwrite original Background source images with the new\n"flamed" images? [Cancel = No]'
  252.     Overwrite = Result
  253.     If Overwrite = 0 Then Do
  254.         AskString 'Enter pathname for "flamed" destination images.\nWITHOUT final "/"\nExample: "DH0:Torchflame/" = wrong  "DH0:Torchflame" = right'
  255.         If RC = 5 Then Do
  256.         Okay 'Exiting...'
  257.         Exit
  258.         End
  259.     End
  260.     If Overwrite = 0 Then Do Forever
  261.         If Result ~= "" Then Do
  262.             FlameDest = Result
  263.             Finder = Exists(FlameDest || '/')
  264.             If Finder = 1 Then Do
  265.                 Leave
  266.                 End
  267.             If Finder = 0 Then Do
  268.                 AskBool 'Drawer not found.  Create one?\n[Cancel = No, lemme try agian]'
  269.                 If Result = 1 Then Do
  270.                     AskBool 'You typed:\n' || FlameDest || '\nIs this the drawer you want?\n[Cancel = No, lemme try agian]'
  271.                     If Result = 1 Then Do
  272.                         Address Command
  273.                         'Makedir ' || FlameDest
  274.                         Address 'OpalPaint_Rexx'
  275.                         Leave
  276.                         End
  277.                     End
  278.                 End
  279.             End
  280.         AskString 'Drawer not found!  Try Again.'
  281.             If RC = 5 Then Do
  282.             Okay 'Exiting...'
  283.             Exit
  284.             End
  285.  
  286.         End
  287.     End
  288.  
  289. If Method = 2 Then Do
  290.     Finder = Exists('Ram:Method2/')
  291.     If Finder = 0 Then Do
  292.         Address COMMAND
  293.         'Makedir ram:Method2'
  294.         End
  295.     BackgroundSource = 'Ram:Method2'
  296.     Address 'OpalPaint_Rexx'
  297.     Save BackgroundSource || '/pic.0001'
  298.     Method = 0
  299.     End
  300.  
  301. /* Here we go!!  I'll take it from here. */
  302. Address 'OpalPaint_Rexx'
  303. Okay 'Here we go.'
  304.  
  305. Busy
  306. GetPrefs
  307. Panic
  308.  
  309. Do A = StartFrame to EndFrame
  310.  
  311.     /* Get IFF Variables */
  312.     Iff = Root || Zero || Zero || Zero || A
  313.     If A < 10000 & A > 999 Then Iff = Root || A
  314.     If A < 1000 & A > 99 Then Iff = Root || Zero || A
  315.     If A < 100 & A > 9  Then Iff = Root || Zero || Zero || A
  316.  
  317.     /* Search for next FLAME frame and load*/
  318.     DisplayStatus 'Find ' || A
  319.     Finder = Exists(FlameSource || '/' || Iff)
  320.     If Finder = 1 Then Do
  321.         Load Flamesource || '/' || Iff
  322.         PageSize
  323.         Parse Var Result X2 Y2
  324.  
  325.         /* Set pots */
  326.         SetPot 1 0 0 0
  327.         SetPot 2 255 255 255
  328.  
  329.         If FlameColour = 1 Then Do
  330.             DisplayStatus 'Normal CLR'
  331.             SetPot 3 255 240 0
  332.             SetPot 4 240 127 0
  333.             SetPot 5 240 0 0
  334.             SetPot 6 120 0 0
  335.             End
  336.         If FlameColour = 2 Then Do
  337.             DisplayStatus 'Yellow CLR'
  338.             SetPot 3 255 240 0
  339.             SetPot 4 210 180 0
  340.             SetPot 5 165 119 0
  341.             SetPot 6 120 58 0
  342.             End
  343.         If FlameColour = 3 Then Do
  344.             DisplayStatus 'Red CLR'
  345.             SetPot 3 255 123 0
  346.             SetPot 4 255 0 0
  347.             SetPot 5 188 0 0
  348.             SetPot 6 120 0 0
  349.             End
  350.         If FlameColour = 4 Then Do
  351.             DisplayStatus 'Blue CLR'
  352.             SetPot 3 0 214 255
  353.             SetPot 4 0 86 255
  354.             SetPot 5 0 43 188
  355.             SetPot 6 0 0 120
  356.             End
  357.         If FlameColour = 5 Then Do
  358.             DisplayStatus 'Green CLR'
  359.             SetPot 3 90 255 90
  360.             SetPot 4 0 255 0
  361.             SetPot 5 0 188 0
  362.             SetPot 6 0 120 0
  363.             End
  364.         If FlameColour = 6 Then Do
  365.             DisplayStatus 'Purple CLR'
  366.             SetPot 3 255 0 235
  367.             SetPot 4 255 0 209
  368.             SetPot 5 172 0 165
  369.             SetPot 6 88 0 120
  370.             End
  371.         SetPot 7 1 1 1
  372.  
  373.  
  374.         DisplayStatus 'Initialze'
  375.         Trans 0
  376.         Texture 0
  377.         FillMode SOLID
  378.         SetDrawMode 1
  379.         SmoothPaper
  380.         ActiveNozzle 1
  381.         MaskSten 0
  382.         ColSten 1
  383.  
  384.         /* Check for special brightness code */
  385.         If Method = 0 Then Do
  386.             DisplayStatus 'Code Check'
  387.             MethodCode = 1
  388.             ReadPixel 0 0
  389.             Parse Var Result R G B
  390.             If R > 0 Then MethodCode = 1
  391.             ReadPixel 1 0
  392.             Parse Var Result R G B
  393.             If R > 0 Then MethodCode = 2
  394.             ReadPixel 2 0
  395.             Parse Var Result R G B
  396.             If R > 0 Then MethodCode = 3
  397.             ReadPixel 3 0
  398.             Parse Var Result R G B
  399.             If R > 0 Then MethodCode = 4
  400.             ReadPixel 4 0
  401.             Parse Var Result R G B
  402.             If R > 0 Then MethodCode = 5
  403.             End
  404.  
  405.         /* Cleanup corner */
  406.         ActivePot 1
  407.         StenEnable 0
  408.         Line 0 0 5 0
  409.  
  410.         /* Turn on Stencil to fix white to 255 255 255 */
  411.         DisplayStatus 'Fix White'
  412.         SetColSten 1 0 0 0 0 0 0 0
  413.         EnableColEntry 1 1
  414.         StenEnable 0
  415.         ActivePot 2
  416.         FreeHand 0 0
  417.         LastPoint 0 0
  418.         StenEnable 1
  419.         RectCut 0 0 X2 Y2
  420.         StenEnable 0
  421.         Handle 0 0
  422.         ColourSource 'PAINTPOT'
  423.         PutBrush 0 0
  424.         ColourSource 'MULTICOLOUR'
  425.  
  426.         BrushSize
  427.         parse var Result BX2 BY2
  428.  
  429.  
  430.         /* Pick up White flame image */
  431.         ActiveNozzle 1
  432.         NozzleSize 1 1
  433.         ActivePot 1
  434.         FreeHand 0 0
  435.         LastPoint 0 0
  436.         StenEnable 1
  437.         DisplayStatus 'Get Brush'
  438.         ActiveBrush 2
  439.         RectCut 0 0 BX2 BY2
  440.         Handle 0 0
  441.  
  442.         /*Get upper-left Brush Sizer */
  443.         BrushSize
  444.         parse var Result BX1 BY1
  445.  
  446.         BX1 = BX2 - BX1
  447.         BY1 = BY2 - BY1
  448.         BX1 = BX1 - (FlameSize + 7)
  449.         BY1 = BY1 - (FlameSize + 7)
  450.         If BX1 < 0 Then BX1 = 0
  451.         If BY1 < 0 Then BY1 = 0
  452.  
  453.         BX2 = BX2 + (FlameSize + 7)
  454.         BY2 = BY2 + (FlameSize + 7)
  455.         If BX2 > X2 Then BX2 = X2
  456.         If BY2 > Y2 Then BY2 = Y2
  457.         StenEnable 0
  458.  
  459.         /* Clean up corner again */
  460.         StenEnable 0
  461.         ActivePot 1
  462.         ActiveNozzle 1
  463.         NozzleSize 0 0
  464.         FreeHand 0 0
  465.         LastPoint 0 0
  466.         Point BX1 BY1
  467.         FreeHand BX1 BY1
  468.         LastPoint BX1 BY1
  469.  
  470.         /* Diffuse White flame image */
  471.         DisplayStatus 'Diffuse 1'
  472.         SetSpare 1 Diffuse
  473.         SetDrawMode 19 FlameSize
  474.         SetDrawMode 19 FlameSize
  475.         SolidRect BX1 BY1 BX2 BY2
  476.  
  477.         /* Add 'Handle Dot' */
  478.         DisplayStatus 'Handle Dot'
  479.         SetDrawMode 1
  480.         ActivePot 7
  481.         ActiveNozzle 1
  482.         NozzleSize 1 1
  483.         Point BX1 BY1
  484.         FreeHand BX1 BY1
  485.         LastPoint BX1 BY1
  486.  
  487.         /* Pick up White flame image */
  488.         StenEnable 1
  489.         DisplayStatus 'Get Brush'
  490.         ActiveBrush 1
  491.         RectCut BX1 BY1 X2 Y2
  492.         Handle 0 0
  493.  
  494.         StenEnable 0
  495.         ActiveNozzle 1
  496.         NozzleSize 1 1
  497.         Point BX1 BY1
  498.         FreeHand BX1 BY1
  499.         LastPoint BX1 BY1
  500.  
  501.         /* Outline Brush with flame colours */
  502.         ActiveBrush 1
  503.         ActivePot 3
  504.         NotBusy
  505.         Key 'o'
  506.         ActivePot 4
  507.         Key 'o'
  508.         Key 'o'
  509.         ActivePot 5
  510.         Key 'o'
  511.         Key 'o'
  512.         ActivePot 6
  513.         Key 'o'
  514.         Busy
  515.  
  516.         /* Stamp coloured brush down */
  517.         DisplayStatus 'stamping'
  518.         Handle 6 6
  519.         StenEnable 0
  520.         ColourSource 'MULTICOLOUR'
  521.         PutBrush BX1 BY1
  522.  
  523.         /* Cleanup corner */
  524.         ActivePot 1
  525.         StenEnable 0
  526.         NewBX1 = BX1 - 6
  527.         If NewBX1 < 0 Then NewBX1 = 0
  528.         NewBY1 = BY1 - 6
  529.         If NewBY1 < 0 Then NewBY1 = 0
  530.         SolidRect NewBX1 NewBY1 (BX1 + 6) (BY1 + 6)
  531.  
  532.         /* Diffuse Coloured flame image */
  533.         DisplayStatus 'Diffuse 2'
  534.         SetDrawMode 19 FlameSize
  535.         SetDrawMode 19 FlameSize
  536.         SolidRect BX1 BY1 BX2 BY2
  537.  
  538.         /* Smooth image */
  539.         ActivePot 1
  540.         ActiveNozzle 1
  541.         NozzleSize 1 1
  542.         SetSpare 1 Blur
  543.         SetDrawMode 19 100
  544.         SetDrawMode 19 100
  545.         Do Smoothy = 1 to SmoothValue
  546.             SolidRect BX1 BY1 BX2 BY2
  547.             End
  548.         SetDrawMode 16 100
  549.         SetDrawMode 16 100
  550.         Do SmoothyB = 1 to 4
  551.             Line NewBX1 0 BX2 0
  552.             End
  553.  
  554.         /* Repair Handle Dot */
  555.         SetDrawMode 1
  556.         ActivePot 7
  557.         Point BX1 BY1
  558.         FreeHand BX1 BY1
  559.         LastPoint BX1 BY1
  560.  
  561.         /* Pick up finished flame brush! */
  562.         ActiveBrush 1
  563.         RectCut BX1 BY1 BX2 BY2
  564.         Handle 0 0
  565.  
  566.         /* Method 0 */
  567.         If Method = 0 Then Do
  568.             If MethodCode = 1 Then Do
  569.                 Load BackgroundSource || '/pic.0001'
  570.                 End
  571.             If MethodCode = 2 Then Do
  572.                 Finder = Exists(BackgroundSource || '/pic.0002')
  573.                 If Finder = 0 Then Load BackgroundSource || '/pic.0001'
  574.                 If Finder = 1 Then Load BackgroundSource || '/pic.0002'
  575.                 End
  576.             If MethodCode = 3 Then Do
  577.                 Finder = Exists(BackgroundSource || '/pic.0003')
  578.                 If Finder = 0 Then Load BackgroundSource || '/pic.0001'
  579.                 If Finder = 1 Then Load BackgroundSource || '/pic.0003'
  580.                 End
  581.             If MethodCode = 4 Then Do
  582.                 Finder = Exists(BackgroundSource || '/pic.0004')
  583.                 If Finder = 0 Then Load BackgroundSource || '/pic.0001'
  584.                 If Finder = 1 Then Load BackgroundSource || '/pic.0004'
  585.                 End
  586.             If MethodCode = 5 Then Do
  587.                 Finder = Exists(BackgroundSource || '/pic.0005')
  588.                 If Finder = 0 Then Load BackgroundSource || '/pic.0001'
  589.                 If Finder = 1 Then Load BackgroundSource || '/pic.0005'
  590.                 End
  591.             End
  592.  
  593.         /* Method 1 */
  594.         If Method = 1 Then Do
  595.             Finder = Exists(BackgroundSource || '/' || Iff)
  596.             If Finder = 0 Then Do
  597.                 Okay 'FATAL ERROR!  Background source image is missing!\nSorry, gotta exit.'
  598.                 Exit
  599.                 End
  600.             Load BackGroundSource || '\' || Iff
  601.             End
  602.  
  603.         /* Add Fire to image */
  604.         SetDrawMode 2 100
  605.         ActiveBrush 1
  606.         Handle 0 0
  607.         Do Loopsy = 1 to FlameIntensity
  608.             Putbrush BX1 BY1
  609.             End
  610.  
  611.         Refresh
  612.  
  613.         /* Save composited image for Method 0 */
  614.         If Method = 0 Then Do
  615.             Save FlameDest || '/' || Iff
  616.             End
  617.  
  618.         /* Save composited image for Method 1 */
  619.         If Method = 1 Then Do
  620.             If Overwrite = 0 Then Do
  621.                 Save FlameDest || '/' || Iff
  622.                 End
  623.             If Overwrite = 1 Then Do
  624.                 Save BackgroundSource || '/' || Iff
  625.                 End
  626.             End
  627.         End
  628.     End
  629.  
  630. /*All Done! */
  631.  
  632. Okay 'Operation Complete!  Go animate it and impress your friends!'
  633.  
  634. NotBusy
  635. Exit
  636.